#-*- coding: utf-8 -*-
#@File    : cookiedemo.PY
#@Time    : 2020/12/1  14:10
#@Software: PyCharm


import requests
# def login(inData):
#     url = 'http://120.55.190.222:7080/api/mgr/loginReq'
#     resp = requests.post(url,data=inData)
#     print(resp.cookies['sessionid'])
#
#
#     #方案一
#     #原生态cookie
#     # cookie1 = login(inData)[0]
#     # print(cookie1)
#     # #其他接口请求
#     # resp = requests.post('路径',cookies = cookie1)
#
# login({'username':'auto','password':'sdfsdfsdf'})


#https 协议

requests.packages.urllib3.disable_warnings()
def login(inData):
    url = 'https://120.55.190.222/api/mgr/loginReq'
    payload = inData
    resp = requests.post(url,data=payload,verify=False)
    print(resp.text)

login({'username':'auto','password':'sdfsdfsdf'})